Imports Sicop.Classi

Partial Class cbNum
    Inherits System.Web.UI.UserControl



#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region


    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
    End Sub


    Public Function check() As Boolean
        'controllo che il valore sia numerico
        If Trim(txCT.Text) = "" Or IsNumeric(Trim(txCT.Text)) Then
            lbErrData.Visible = False
            Return True
        Else
            lbErrData.Visible = True
            Return False
        End If
    End Function


    Public Property etichetta() As String
        Get
            Return lbCT.Text
        End Get
        Set(ByVal Value As String)
            lbCT.Text = Value
        End Set
    End Property

    Public Property testo() As String
        Get
            Return Trim(txCT.Text)
        End Get
        Set(ByVal Value As String)
            txCT.Text = Value
        End Set
    End Property

    Public Property sel() As Int16
        Get
            Return dCT.SelectedValue
        End Get
        Set(ByVal Value As Int16)
            Utility.selLista(dCT, Value)
        End Set
    End Property

    Public Property selIndex() As Int16
        Get
            Return dCT.SelectedIndex
        End Get
        Set(ByVal Value As Int16)
            dCT.SelectedIndex = Value
        End Set
    End Property

    Public ReadOnly Property selText() As String
        Get
            Return dCT.SelectedItem.Text()
        End Get
    End Property

End Class
